<?php /* Template Name: Faq */ ?>

<script type="text/javascript">
 function showHide(obj) {
   var div = document.getElementById(obj);
   if (div.style.display == 'none') {
     div.style.display = 'block';
   }
   else {
     div.style.display = 'none';
   }
 }
</script>

<?php get_header(); ?>
<body>

<div id="tudo">

<div id="topo"><?php include_once TOPO_TEMPLATE; ?></div><!-- Fim div topo -->
<?php do_vertical_space('20'); ?>

<div id="corpo">
	
	<div id="miolo">
		<?php do_vertical_space('15'); ?>
		<div class="breadcrumb"><?php the_breadcrumb(); ?></div>
		<?php do_vertical_space('15'); ?>
		<h1 class="font-azul">Perguntas frequêntes</h1>
		<h2>Como Podemos Ajudá-lo?</h2>
		<?php	
		$num = 0;	
		$temp = $wp_query;
		$wp_query= null;
		$wp_query = new WP_Query();
		$wp_query->query('category_name=faq&posts_per_page=20&order=DESC'.'&paged='.$paged);
		while ($wp_query->have_posts()) : $wp_query->the_post(); 
			$num = $num + 1; ?>
			<h3><a href="# <?php echo $num;?>" onclick="showHide('hidden_div<?php echo $num;?>');"><?php the_title(); ?></a></h3>
			<div id="hidden_div<?php echo $num;?>" style="display: none;">
			  	<div class="faq"><a id="<?php echo $num;?>"><span style="color: #020202;"><?php the_content(); ?></span></a></div>
			</div>
		<?php 
		endwhile; 
		?>	
		<div class="clr"></div>
		<?php 
		do_vertical_space('10'); 
		//Faz a paginação do conteúdo
		$url = get_bloginfo( 'url' );
		$url = $url.'/faq/';
		pagination( $wp_query, $url );
		?>
	</div><!-- Fim div miolo -->
	
	<div id="direita">
		<?php dynamic_sidebar( 'Lateral Direita Home' ); ?>
		<?php do_vertical_space('20');?>
	</div><!-- Fim div coluna_direita -->
	
</div><!-- Fim div corpo -->

<?php do_vertical_space('20'); ?>	

<div class="cont-miolo-pub"><?php add_google_pub_bloco_2x468x60 (); ?></div>
<?php do_vertical_space('20'); ?>		

</div><!-- Fim div tudo -->
<?php get_footer(); ?>

</body>

</html>